using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using Yoozoo.UI;
public class YToggleGroupBinderTreeItem : BindingBinderTreeItemBase
{
    public static Dictionary<YToggleGroupBinder.AttributeType, LinkerValueState> AttributeValueDic = new Dictionary<YToggleGroupBinder.AttributeType, LinkerValueState>
    {
        {YToggleGroupBinder.AttributeType.onValueChanged, LinkerValueState.UnityEvent2Int32},
        {YToggleGroupBinder.AttributeType.allowSwitchOff, LinkerValueState.Boolean},
        {YToggleGroupBinder.AttributeType.selected, LinkerValueState.Int32},
        {YToggleGroupBinder.AttributeType.enabled, LinkerValueState.Boolean},
    };
    public YToggleGroupBinderTreeItem() : base(typeof(YToggleGroupBinder))
    {
    }
    
    public override void RebuildTree()
    {
        base.RebuildTree();
        foreach (YToggleGroupBinder.AttributeType binderType in Enum.GetValues(typeof(YToggleGroupBinder.AttributeType)))
        {
            BindingLinkerTreeItem linkerTreeItem = new BindingLinkerTreeItem(binderType.ToString(), binderType.ToString(), (int)AttributeValueDic[binderType]);
            AddChild(linkerTreeItem);
        }
    }
}